package com.itheima.service.impl;

import com.itheima.bean.User;
import com.itheima.controller.UserServlet;
import com.itheima.mapper.UserMapper;
import com.itheima.service.UserService;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.io.InputStream;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 定义登录的方法
     * @param user 封装用于登录的用户名和密码
     * @return 返回查到的用户信息
     */
    @Override
    public User login(User user) {

        //6 返回结果
        return  userMapper.login(user);
    }
}
